//svg插件需要配置代码
import 'virtual:svg-icons-register'

import { createApp } from 'vue'
import App from '@/App.vue'

//引入element-plus插件与样式
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

// import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import zhCn from 'element-plus/es/locale/lang/zh-cn'

// 暗黑模式需要的样式
import 'element-plus/theme-chalk/dark/css-vars.css'

import globalComponents from '@/components/index'

import { isHasButton } from '@/directive/has'

import '@/styles/index.scss'

import router from '@/router'
import pinia from '@/store'

//获取应用实例对象
const app = createApp(App)

//安装element-plus插件
app.use(ElementPlus, {
  locale: zhCn //element-plus国际化配置
})

app.use(globalComponents)

isHasButton(app)

app.use(pinia)

app.use(router)

import './permisstion'

//将应用挂载到挂载点上
app.mount('#app')
